/**
 * @file Logger.hh
 * @author Bono.ASUN.TamGitsun (gitsun.tam@outlook.com)
 * @brief 
 * @version 0.1
 * @date 2022-02-06
 * 
 * @copyright Copyright (c) 2022
 * 
 */


#pragma once


#include "ILogger.hh"
#include <stdio.h>


namespace TGS::utils {


class Logger: public ILogger
{
public:
    virtual void set_log_level(int level);
protected:
    int mLevel {ILogger::LEVEL_VERBOSE};
};


/**
 * @brief Get the default instance of @link ILogger
 * 
 * @return ILogger& The default instance of @link ILogger
 */
ILogger & DLogger(void);


#define mlog_v(tag, file, fmt, ...) DLogger().log_v("V [" tag "] | " file " (%s:%d) " fmt "\n", __func__, __LINE__, ##__VA_ARGS__)
#define mlog_d(tag, file, fmt, ...) DLogger().log_d("D [" tag "] | " file " (%s:%d) " fmt "\n", __func__, __LINE__, ##__VA_ARGS__)
#define mlog_i(tag, file, fmt, ...) DLogger().log_i("I [" tag "] | " file " (%s:%d) " fmt "\n", __func__, __LINE__, ##__VA_ARGS__)
#define mlog_w(tag, file, fmt, ...) DLogger().log_w("W [" tag "] | " file " (%s:%d) " fmt "\n", __func__, __LINE__, ##__VA_ARGS__)
#define mlog_e(tag, file, fmt, ...) DLogger().log_e("E [" tag "] | " file " (%s:%d) " fmt "\n", __func__, __LINE__, ##__VA_ARGS__)
#define mlog_wtf(tag, file, fmt, ...) DLogger().log_wtf("F|[" tag "] | " file " (%s:%d) " fmt "\n", __func__, __LINE__, ##__VA_ARGS__)


}
